<?php
require 'Home/Controller/Controller.php ';

require 'Home/Model/IndexModel.php';
class ListController extends Controller{
	function __Construct(){
		parent::__Construct();
		$this->model = new IndexModel();
	}
	function index(){
		$id = $_GET['id'];

		$getVideoType = $this->model->getVideoType();
		$getVideoByTid = $this->model->getVideoByid($id);
		$getVideoByHits = $this->model->getVideoByHits();
		$getTypeById = $this->model->getTypeByTid($id);


		include 'Home/View/Index/list.php';
	}
	function add(){
		$data = $_POST;
		$result = $this->model->add($data);
		if($result){
			echo '添加成功 <a href="admin.php?c=user&m=index">如果没有跳转，请点这里跳转</a>';
   			header("refresh:3;url='admin.php?c=user&m=index'");
		}
		else{
			echo "添加失败！<br/>";
  			echo "<a href='admin.php?c=user&m=form'>返回</a>";
		}

}
?>